package edu.cmu.aes.project2;

import java.rmi.RemoteException;

import edu.cmu.aes.project2.ws.supplier.BikeInfo;
import edu.cmu.aes.project2.ws.supplier.Order;
import edu.cmu.aes.project2.ws.supplier.SupplierServiceProxy;

public class SupplierService {
	  public String[] getBrands(){
		  edu.cmu.aes.project2.ws.supplier.SupplierService service = new SupplierServiceProxy();
		  try {
			return service.getBrands();
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	  }
	  
	  public String[] getModels(String brand){
		  edu.cmu.aes.project2.ws.supplier.SupplierService service = new SupplierServiceProxy();
		  try {
			return service.getModels(brand);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	  }
	  
	  public BikeInfo getDetails(String model){
		  edu.cmu.aes.project2.ws.supplier.SupplierService service = new SupplierServiceProxy();
		  try {
			return service.getDetails(model);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	  }

	  public boolean placeOrder(Order order){
		  edu.cmu.aes.project2.ws.supplier.SupplierService service = new SupplierServiceProxy();
		  try {
			return service.placeOrder(order);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return false;
	  } 
}
